import { Select } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import { useOptions } from "@/hooks"
import { useLocale } from "@/locales"

const RebateFrozenStatusSelect: FC<{ isHideLabel?: boolean; width?: number; name?: string }> = ({
	isHideLabel = false,
	width = 200,
	name
}) => {
	const { newFormat, formatMessage } = useLocale()

	const options = useOptions({ modal: "frozenStatusList", func: formatMessage })

	return (
		<SFormItem name={name || "rebateFrozenStatus"} label={isHideLabel ? "" : newFormat("risk.rebate_frozen_status")}>
			<Select
				allowClear
				placeholder={newFormat("common.select_all")}
				options={options}
				style={{ width: width }}
				defaultValue={"1"}
			/>
		</SFormItem>
	)
}

export default RebateFrozenStatusSelect
